<?php

use think\facade\Route;
use app\admin\middleware\LoginMiddleware;
use app\admin\middleware\AuthMiddleware;
use app\admin\middleware\OperationLog;

Route::group('addons', function () {
    Route::group('manage', function () {
        //用户信息
        Route::get('userInfo', 'addons.Manage/userInfo');
        //用户登录
        Route::post('login', 'addons.Manage/login');
        //退出登录
        Route::get('logout', 'addons.Manage/logout');
        //刷新缓存
        Route::get('refresh', 'addons.Manage/refresh');
        //插件列表
        Route::get('lists', 'addons.Manage/lists');
        //插件分类列表
        Route::get('categoryLists', 'addons.Manage/categoryLists');
        //本地插件列表
        Route::get('localLists', 'addons.Manage/localLists');
        //插件详情
        Route::get('detail', 'addons.Manage/detail');
        //本地插件详情
        Route::get('localDetail', 'addons.Manage/localDetail');
        //安装下载
        Route::post('download', 'addons.Manage/download');
        //安装插件
        Route::post('install', 'addons.Manage/install');
        //卸载插件
        Route::post('uninstall', 'addons.Manage/uninstall');
        //更新插件
        Route::post('update', 'addons.Manage/update');
        //导入插件
        Route::post('import', 'addons.Manage/import');
        //获取终端命令
        Route::get('depends', 'addons.Manage/depends');
        //获取终端命令
        Route::get('commands', 'addons.Manage/commands');
        //执行命令
        Route::post('execute', 'addons.Manage/execute');
        //执行终端命令
        Route::get('terminal', 'addons.Manage/terminal');
    });
})->middleware([
    LoginMiddleware::class,
    AuthMiddleware::class,
    OperationLog::class
]);